<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>sim.moveToPose</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
</head>

<body>

<div align="center">
<table class=allEncompassingTable >
 <tr>
  <td >
<p><a href="../../index.html" TARGET="_top"><img src="../images/homeImg.png"></a></p>

<h1>Regular API function</h1>
<h3 class=subsectionBar><a name="simMoveToPose" id="simMoveToPose"></a>sim.moveToPose 
</h3>
<table class=apiTable>
<tr class=apiTableTr> 
<td class=apiTableLeftDescr>
Description 
</td> 
<td class=apiTableRightDescr>Generates object movement data using the <a href="https://github.com/pantor/ruckig#readme">Ruckig online trajectory generator</a>, by performing interpolations between two poses. The function can operate by handling 4 movement variables (x,y,z and angle between the two poses), or a single movement variable (t, which requires a metric to be specified for distance calculation between the two poses). This function can only be called from <a href="../childScripts.htm">child scripts</a> running in a thread or from a coroutine (since this is a blocking operation). See also <a href="simMoveToConfig.htm">sim.moveToConfig</a>, and <a href="simRuckigPos.htm">sim.ruckigPos</a>.</td>
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCSyn>
C synopsis
</td> 
<td class=apiTableRightCSyn></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCParam>C parameters</td> 
<td class=apiTableRightCParam></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCRet>
C return value
</td> 
<td class=apiTableRightCRet>

</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLSyn>
Lua synopsis
</td> 
<td class=apiTableRightLSyn>table[7]/table[12] endPose/endMatrix,float timeLeft=sim.moveToPose(int flags,table[7]/table[12] currentPose/currentMatrix,table[] maxVel,table[] maxAccel,table[] maxJerk,table[7]/table[12] targetPose/targetMatrix,function callback,auxData,table[4] metric=nil,float timeStep=0)</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLParam>Lua parameters</td> 
<td class=apiTableRightLParam>
<div><strong>flags</strong>: <a href="../apiConstants.htm#ruckigFunctions">Ruckig flags</a>. -1 for default flags.</div>
<div><strong>currentPose/currentMatrix</strong>: the start pose, specified via a pose (x,y,z,qx,qy,qz,qw) or transformation matrix (the last row of the 4x4 matrix is omitted).</div>
<div><strong>maxVel</strong>: the maximum allowed velocity. If <em>metric</em> is specified, then this is a table of size 1, otherwse a table of size 4.</div>
<div><strong>maxAccel</strong>: the maximum allowed acceleration. If <em>metric</em> is specified, then this is a table of size 1, otherwse a table of size 4.</div>
<div><strong>maxJerk</strong>: the maximum allowed jerk. If <em>metric</em> is specified, then this is a table of size 1, otherwse a table of size 4.</div>
<div><strong>targetPose/targetMatrix</strong>: the goal pose, specified via a pose (x,y,z,qx,qy,qz,qw) or transformation matrix (the last row of the 4x4 matrix is omitted).</div>
<div><strong>callback</strong>: a callback function that will be called for each movement step. The arguments provided to the callback function are: currentPose/currentMatrix, currentVel, currentAccel, auxData.</div>
<div><strong>auxData</strong>: random data that will be forwarded to the callback function.</div>
<div><strong>metric</strong>: an optional metric, used to compute a pose-pose distance. If metric is nil, the movement calculation happens in the 4-dimensional space (x,y,z,angle), otherwise it happens in the 1-dimensional space (t).</div>
<div><strong>timeStep</strong>: the desired time step size. A value of 0 indicates that the current simulation time step will be used.</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLRet>
Lua return values
</td> 
<td class=apiTableRightLRet>
<div><strong>endPose/endMatrix</strong>: the pose at the end of the movement, specified via a pose (x,y,z,qx,qy,qz,qw) or transformation matrix (the last row of the 4x4 matrix is omitted).</div>
<div><strong>timeLeft</strong>: the leftover time in current simulation step, i.e. the remaining time that was not used for movement.</div>
</td> 
</tr> 
</table> 


<br>
</td>
</tr>
</table>
</div>
</body>
</html>
